package org.cloud.api.auth.client.callbackfactory;

import org.cloud.api.auth.client.client.SlothAuthenticationClient;
import org.cloud.common.model.R;

import feign.hystrix.FallbackFactory;

/**
 * 
 * @author wangyuan
 * @since 2019年6月5日 下午4:07:13
 *
 */
public class SlothAuthenticationClientFallbackFactory implements FallbackFactory<SlothAuthenticationClient> {

	@Override
	public SlothAuthenticationClient create(Throwable cause) {
		return new SlothAuthenticationClient() {

			@Override
			public R authenticateService(String requestUri) {
				return R.error("请求错误，原因是：" + cause.getMessage());
			}
		};
	}

}
